"""
Configuration file for Sperm Bank Management System
"""

import os
from dotenv import load_dotenv

load_dotenv()

class Config:
    """Base configuration"""
    
    # Database configuration
    DB_HOST = os.getenv('DB_HOST', 'localhost')
    DB_PORT = os.getenv('DB_PORT', '5432')
    DB_NAME = os.getenv('DB_NAME', 'hospital_db')
    DB_USER = os.getenv('DB_USER', 'hospital_user')
    DB_PASSWORD = os.getenv('DB_PASSWORD', 'Hospital@2025')
    
    # Flask configuration
    SECRET_KEY = os.getenv('SECRET_KEY', 'change-this-to-random-secret-key')
    DEBUG = os.getenv('FLASK_DEBUG', 'False').lower() == 'true'
    
    # Server configuration
    HOST = os.getenv('HOST', '0.0.0.0')
    PORT = int(os.getenv('PORT', 5000))
    
    @staticmethod
    def get_db_config():
        """Get database configuration as dictionary"""
        return {
            'host': Config.DB_HOST,
            'port': Config.DB_PORT,
            'database': Config.DB_NAME,
            'user': Config.DB_USER,
            'password': Config.DB_PASSWORD
        }

